home *** CD-ROM | disk | FTP | other *** search
/ Stockbyte 99: Retail Therapy / Stockbyte - Retail Therapy - Disc 1.iso / mac / Mac Browser / Portfolio Help / bsscdht1.js < prev    next >
Text File  |  2000-04-26  |  32KB  |  892 lines

  1. //////////BSSCDHTML Section 1//////////
  2. // RoboHELP« Dynamic HTML Effects Script
  3. // Copyright ⌐ 1998-1999 Blue Sky Software Corporation.  All rights reserved.
  4.  
  5. // Version=3.55
  6.  
  7. // Warning:  Do not modify this file.  It is generated by RoboHELP« and changes will be overwritten.
  8.  
  9. //{{HH_SYMBOL_SECTION
  10. var HH_ChmFilename = "";
  11. var HH_WindowName = "";
  12. var HH_GlossaryFont = "";
  13. var HH_Glossary = "";
  14. var HH_Avenue = "";
  15. //}}HH_SYMBOL_SECTION
  16.  
  17. var gbNav4 = false;
  18. var gbIE4 = false;
  19. var gbIE = false;
  20. var gbIE5 = false;
  21. var gAgent = navigator.userAgent.toLowerCase(); 
  22. var gbMac = (gAgent.indexOf("mac") != -1);
  23. var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));
  24.  
  25. var error_count = 0;
  26.  
  27. gbIE = (navigator.appName.indexOf("Microsoft") != -1);
  28. if (parseInt(navigator.appVersion) >= 4) {
  29.     gbNav4 = (navigator.appName == "Netscape");
  30.     gbIE4 = (navigator.appName.indexOf("Microsoft") != -1);
  31.  
  32.     if (gbIE4) {
  33.         if (gAgent.indexOf("msie 5.0") != -1) {
  34.             gbIE5 = true;
  35.         }
  36.     }
  37. }
  38.  
  39. function HHActivateComponents()
  40. {
  41.     if ((HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
  42.     {
  43.         var objBody = document.all.tags("BODY")[0];
  44.         objBody.insertAdjacentHTML("beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
  45.         if (HHComponentActivator.object)
  46.         {
  47.             HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
  48.         }
  49.     }
  50. }
  51.  
  52. var gAmc = new Array();
  53. var BSSCSequenceIndex = 0;
  54.  
  55. function animationContext(el, progressAnimation, finishAnimiation, animationDuration, animationPeriod)
  56. {
  57.     this.el = el;
  58.     this.progressAnimation = progressAnimation;
  59.     this.finishAnimiation = finishAnimiation;
  60.     this.animationDuration = parseFloat(animationDuration);
  61.     this.animationPeriod = animationPeriod;
  62.     this.animationStartTime = (new Date()).getTime();
  63.     this.continueAnimation = true;
  64. }
  65.  
  66. function progressFade(ndx)
  67. {
  68.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  69.     if (percent > 1.0){
  70.         percent = 1.0;
  71.         gAmc[ndx].continueAnimation = false;
  72.     }
  73.     gAmc[ndx].el.filters.alpha.opacity = gAmc[ndx].initialOpacity*(1.0-percent) +  gAmc[ndx].finalOpacity*percent;
  74. }
  75.  
  76. function finishFade(ndx)
  77. {
  78.     gAmc[ndx].el.filters.alpha.opacity = parseInt(gAmc[ndx].finalOpacity);
  79. }
  80.  
  81. function progressTranslation(ndx)
  82. {
  83.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  84.     if (percent > 1.0)    {
  85.         percent = 1.0;
  86.         gAmc[ndx].continueAnimation = false;
  87.     }
  88.     gAmc[ndx].el.style.pixelLeft = gAmc[ndx].startX*(1.0-percent) +  gAmc[ndx].finalX*percent;
  89.     gAmc[ndx].el.style.pixelTop = gAmc[ndx].startY*(1.0-percent) +  gAmc[ndx].finalY*percent;
  90. }
  91. function progressSpiral(ndx)
  92. {
  93.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  94.     if (percent > 1.0)    {
  95.         percent = 1.0;
  96.         gAmc[ndx].continueAnimation = false;
  97.     }
  98.     rf = 1.0 - percent
  99.     t = percent * 2.0*Math.PI
  100.     rx = Math.max(Math.abs(gAmc[ndx].el.initLeft), 200)
  101.     ry = Math.max(Math.abs(gAmc[ndx].el.initTop),  200)
  102.     gAmc[ndx].el.style.pixelLeft = Math.ceil(-rf*Math.cos(t)*rx)
  103.     gAmc[ndx].el.style.pixelTop  = Math.ceil(-rf*Math.sin(t)*ry)
  104.     gAmc[ndx].el.style.visibility="visible"    
  105. }
  106.  
  107. function progressElasticFromRight(ndx)
  108. {
  109.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  110.     if (percent > 1.0)    {
  111.         percent = 1.0;
  112.         gAmc[ndx].continueAnimation = false;
  113.     }
  114.     rf=Math.exp(-percent*7)
  115.     t = percent * 1.5*Math.PI
  116.     rx =Math.abs(gAmc[ndx].el.initLeft)
  117.     gAmc[ndx].el.style.pixelLeft = rf*Math.cos(t)*rx
  118.     gAmc[ndx].el.style.pixelTop = 0
  119.     gAmc[ndx].el.style.visibility="visible"    
  120. }
  121. function progressElasticFromBottom(ndx)
  122. {
  123.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  124.     if (percent > 1.0)    {
  125.         percent = 1.0;
  126.         gAmc[ndx].continueAnimation = false;
  127.     }
  128.     rf=Math.exp(-percent*7)
  129.     t = percent * 1.5*Math.PI
  130.     rx =Math.abs(gAmc[ndx].el.initTop)
  131.     gAmc[ndx].el.style.pixelLeft = 0
  132.     gAmc[ndx].el.style.pixelTop = rf*Math.cos(t)*rx
  133.     gAmc[ndx].el.style.visibility="visible"    
  134. }
  135.  
  136. function progressZoomIn(ndx)
  137. {
  138.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  139.     if (percent > 1.0)    {
  140.         percent = 1;
  141.         gAmc[ndx].continueAnimation = false;
  142.     }
  143.     for (var index=0; index<gAmc[ndx].el.all.length; index++) {
  144.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(50+50*percent) + "%"
  145.     }
  146.     gAmc[ndx].el.posLeft = 100
  147.     gAmc[ndx].el.style.visibility="visible"
  148.  
  149.     if (percent >= 1.0)    {
  150.         finishZoom(ndx);
  151.     }
  152. }
  153.  
  154. function progressZoomOut(ndx)
  155. {
  156.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  157.     if (percent > 1.0)    {
  158.         percent = 1.0;
  159.         gAmc[ndx].continueAnimation = false;
  160.     }
  161.  
  162.     for (var index=0; index<gAmc[ndx].el.all.length; index++)
  163.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(100+200*(1-percent)) + "%"
  164.     gAmc[ndx].el.posLeft = 0
  165.     gAmc[ndx].el.style.visibility="visible"
  166.  
  167.     if (percent >= 1.0)    {
  168.         finishZoom(ndx);
  169.     }
  170. }
  171. function finishTranslation(ndx)
  172. {
  173.     gAmc[ndx].el.style.pixelLeft = parseInt(gAmc[ndx].finalX);
  174.     gAmc[ndx].el.style.pixelTop = parseInt(gAmc[ndx].finalY);
  175. }
  176. function finishZoom(ndx)
  177. {
  178.     for (i=0; i<gAmc[ndx].el.all.length; i++)
  179.         gAmc[ndx].el.all[i].style.fontSize = gAmc[ndx].OldFont
  180.  
  181.  
  182. function animationPump(ndx)
  183. {
  184.     gAmc[ndx].progressAnimation(ndx);
  185.     if (gAmc[ndx].continueAnimation)
  186.         gAmc[ndx].tm = setTimeout("animationPump(" + ndx + ");", gAmc[ndx].animationPeriod);
  187. }
  188.  
  189. function clearAnimations()
  190. {
  191.     for (var index=0; index<gAmc.length; index++) {
  192.         gAmc[index].finishAnimiation(index);
  193.         clearTimeout(gAmc[index].tm);
  194.     }
  195.     gAmc = new Array();
  196. }
  197.  
  198. function startNextAnimationSet()
  199. {
  200.     clearAnimations();
  201.     bStarted = false;
  202.     bFound = false
  203.  
  204.     // Determine the next sequence number
  205.     divElements = document.all.tags("DIV");
  206.     for (var index = 0; index < divElements.length; index++) 
  207.     {
  208.         el = divElements[index];
  209.         objectOrder = el.getAttribute("BSSCObjectOrder", false);
  210.         if(null != objectOrder)
  211.         {
  212.             objectOrder = parseInt(objectOrder);
  213.             if (objectOrder > BSSCSequenceIndex && (!bFound || objectOrder < minBSSCSequenceIndexFound))
  214.             {
  215.                 minBSSCSequenceIndexFound = objectOrder;
  216.                 bFound = true;
  217.             }
  218.         }
  219.     }
  220.  
  221.     if (bFound)
  222.     {
  223.         BSSCSequenceIndex = minBSSCSequenceIndexFound;
  224.         bStarted = startAnimationSet(BSSCSequenceIndex);
  225.     }
  226. }
  227.  
  228. function getOffsetFromTopOfBrowser(el)
  229. {
  230.     if (null == el.offsetParent)
  231.         return el.offsetTop;
  232.     else
  233.         return el.offsetTop + getOffsetFromTopOfBrowser(el.offsetParent);
  234. }
  235.  
  236. function startAnimationSet(ndx)
  237. {
  238.     var m = 0;
  239.     bStarted = false;
  240.  
  241.     // Find document elements with "BSSCAnimationType" attribute
  242.     divElements = document.all.tags("DIV");
  243.     for (var index = 0; index < divElements.length; index++)
  244.     {
  245.         el = divElements[index];
  246.         
  247.         animationType = el.getAttribute("BSSCAnimationType", false);
  248.         if(null != animationType)
  249.         {
  250.             framePeriod = el.getAttribute("BSSCFramePeriod", false);
  251.             frameCount = el.getAttribute("BSSCFrameCount", false);
  252.             sequenceIndex = el.getAttribute("BSSCObjectOrder", false);
  253.  
  254.             // Stop any currently running RevealTrans filters
  255.             if ("RevealTrans" == animationType && parseInt(sequenceIndex) == ndx-1 && gbWindows)
  256.                 el.filters.RevealTrans.stop();  
  257.             // Filter on ndx
  258.             if (0 == ndx && null == sequenceIndex ||
  259.                 ndx == parseInt(sequenceIndex))
  260.             {
  261.                 if ("FlyInFromRight" == animationType)
  262.                 {
  263.                     animationDuration = el.getAttribute("BSSCDuration", false);
  264.                     if (null == animationDuration)
  265.                         animationDuration = 1000; // default to 1s
  266.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  267.                     gAmc[m].startX = document.body.clientWidth + document.body.scrollLeft;
  268.                     gAmc[m].startY = 0;
  269.                     gAmc[m].finalX = 0;
  270.                     gAmc[m].finalY = 0;
  271.                     animationPump(m++);
  272.                     bStarted = true;
  273.                 }
  274.                 if ("FlyOutToRight" == animationType)
  275.                 {
  276.                     animationDuration = el.getAttribute("BSSCDuration", false);
  277.                     if (null == animationDuration)
  278.                         animationDuration = 1000; // default to 1s
  279.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  280.                     gAmc[m].startX = 0;
  281.                     gAmc[m].startY = 0;
  282.                     gAmc[m].finalX = document.body.clientWidth + document.body.scrollWidth;
  283.                     gAmc[m].finalY = 0;
  284.                     animationPump(m++);
  285.                     bStarted = true;
  286.                 }
  287.                 if ("FlyInFromLeft" == animationType)
  288.                 {
  289.                     animationDuration = el.getAttribute("BSSCDuration", false);
  290.                     if (null == animationDuration)
  291.                         animationDuration = 1000; // default to 1s
  292.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  293.                     {
  294.                         if ("left" == el.children[childIndex].style.textAlign)
  295.                             el.children[childIndex].style.textAlign = "right";
  296.                     }
  297.                     pixelsToTranslate = document.body.clientWidth;
  298.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  299.                     gAmc[m].startX = -(document.body.clientWidth + document.body.scrollLeft);
  300.                     gAmc[m].startY = 0;
  301.                     gAmc[m].finalX = 0;
  302.                     gAmc[m].finalY = 0;
  303.                     animationPump(m++);
  304.                     bStarted = true;
  305.                 }
  306.                 if ("FlyOutToLeft" == animationType)
  307.                 {
  308.                     animationDuration = el.getAttribute("BSSCDuration", false);
  309.                     if (null == animationDuration)
  310.                         animationDuration = 1000; // default to 1s
  311.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  312.                     {
  313.                         if ("left" == el.children[childIndex].style.textAlign)
  314.                             el.children[childIndex].style.textAlign = "right";
  315.                     }
  316.                     pixelsToTranslate = document.body.clientWidth;
  317.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  318.                     gAmc[m].startX = 0;
  319.                     gAmc[m].startY = 0;
  320.                     gAmc[m].finalX = -(document.body.clientWidth + document.body.scrollWidth);
  321.                     gAmc[m].finalY = 0;
  322.                     animationPump(m++);
  323.                     bStarted = true;
  324.                 }
  325.                 if ("FlyInFromBottom" == animationType)
  326.                 {
  327.                     animationDuration = el.getAttribute("BSSCDuration", false);
  328.                     if (null == animationDuration)
  329.                         animationDuration = 1000; // default to 1s
  330.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  331.                     gAmc[m].startX = 0;
  332.                     gAmc[m].startY = document.body.clientHeight + document.body.scrollTop;
  333.                     gAmc[m].finalX = 0;
  334.                     gAmc[m].finalY = 0;
  335.                     animationPump(m++);
  336.                     bStarted = true;
  337.                 }
  338.                 if ("FlyOutToBottom" == animationType)
  339.                 {
  340.                     animationDuration = el.getAttribute("BSSCDuration", false);
  341.                     if (null == animationDuration)
  342.                         animationDuration = 1000; // default to 1s
  343.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  344.                     gAmc[m].startX = 0;
  345.                     gAmc[m].startY = 0;
  346.                     gAmc[m].finalX = 0;
  347.                     gAmc[m].finalY = document.body.clientHeight + document.body.scrollHeight;
  348.                     animationPump(m++);
  349.                     bStarted = true;
  350.                 }
  351.                 if ("FlyInFromTop" == animationType)
  352.                 {
  353.                     animationDuration = el.getAttribute("BSSCDuration", false);
  354.                     if (null == animationDuration)
  355.                         animationDuration = 1000; // default to 1s
  356.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  357.                     gAmc[m].startX = 0;
  358.                     gAmc[m].startY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  359.                     gAmc[m].finalX = 0;
  360.                     gAmc[m].finalY = 0;
  361.                     animationPump(m++);
  362.                     bStarted = true;
  363.                 }
  364.                 if ("FlyOutToTop" == animationType)
  365.                 {
  366.                     animationDuration = el.getAttribute("BSSCDuration", false);
  367.                     if (null == animationDuration)
  368.                         animationDuration = 1000; // default to 1s
  369.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  370.                     gAmc[m].startX = 0;
  371.                     gAmc[m].startY = 0;
  372.                     gAmc[m].finalX = 0;
  373.                     gAmc[m].finalY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  374.                     animationPump(m++);
  375.                     bStarted = true;
  376.                 }
  377.                 if ("FlyInFromBottomRight" == animationType)
  378.                 {
  379.                     animationDuration = el.getAttribute("BSSCDuration", false);
  380.                     if (null == animationDuration)
  381.                         animationDuration = 1000; // default to 1s
  382.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  383.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  384.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  385.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  386.                     gAmc[m].startX = pixelsToTranslate;
  387.                     gAmc[m].startY = pixelsToTranslate;
  388.                     gAmc[m].finalX = 0;
  389.                     gAmc[m].finalY = 0;
  390.                     animationPump(m++);
  391.                     bStarted = true;
  392.                 }
  393.                 if ("FlyOutToBottomRight" == animationType)
  394.                 {
  395.                     animationDuration = el.getAttribute("BSSCDuration", false);
  396.                     if (null == animationDuration)
  397.                         animationDuration = 1000; // default to 1s
  398.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  399.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  400.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  401.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  402.                     gAmc[m].startX = 0;
  403.                     gAmc[m].startY = 0;
  404.                     gAmc[m].finalX = pixelsToTranslate;
  405.                     gAmc[m].finalY = pixelsToTranslate;
  406.                     animationPump(m++);
  407.                     bStarted = true;
  408.                 }
  409.                 if ("FlyInFromTopRight" == animationType)
  410.                 {
  411.                     animationDuration = el.getAttribute("BSSCDuration", false);
  412.                     if (null == animationDuration)
  413.                         animationDuration = 1000; // default to 1s
  414.                     pixelsToTranslate = document.body.clientWidth;
  415.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  416.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  417.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  418.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  419.                     gAmc[m].startX = pixelsToTranslate;
  420.                     gAmc[m].startY = -pixelsToTranslate;
  421.                     gAmc[m].finalX = 0;
  422.                     gAmc[m].finalY = 0;
  423.                     animationPump(m++);
  424.                     bStarted = true;
  425.                 }
  426.                 if ("FlyOutToTopRight" == animationType)
  427.                 {
  428.                     animationDuration = el.getAttribute("BSSCDuration", false);
  429.                     if (null == animationDuration)
  430.                         animationDuration = 1000; // default to 1s
  431.                     pixelsToTranslate = document.body.clientWidth;
  432.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  433.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  434.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  435.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  436.                     gAmc[m].startX = 0;
  437.                     gAmc[m].startY = 0;
  438.                     gAmc[m].finalX = pixelsToTranslate;
  439.                     gAmc[m].finalY = -pixelsToTranslate;
  440.                     animationPump(m++);
  441.                     bStarted = true;
  442.                 }
  443.                 if ("FlyInFromTopLeft" == animationType)
  444.                 {
  445.                     animationDuration = el.getAttribute("BSSCDuration", false);
  446.                     if (null == animationDuration)
  447.                         animationDuration = 1000; // default to 1s
  448.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  449.                     {
  450.                         if ("left" == el.children[childIndex].style.textAlign)
  451.                             el.children[childIndex].style.textAlign = "right";
  452.                     }
  453.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  454.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  455.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  456.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  457.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  458.                     gAmc[m].startX = -pixelsToTranslate;
  459.                     gAmc[m].startY = -pixelsToTranslate;
  460.                     gAmc[m].finalX = 0;
  461.                     gAmc[m].finalY = 0;
  462.                     animationPump(m++);
  463.                     bStarted = true;
  464.                 }
  465.                 if ("FlyOutToTopLeft" == animationType)
  466.                 {
  467.                     animationDuration = el.getAttribute("BSSCDuration", false);
  468.                     if (null == animationDuration)
  469.                         animationDuration = 1000; // default to 1s
  470.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  471.                     {
  472.                         if ("left" == el.children[childIndex].style.textAlign)
  473.                             el.children[childIndex].style.textAlign = "right";
  474.                     }
  475.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  476.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  477.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  478.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  479.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  480.                     gAmc[m].startX = 0;
  481.                     gAmc[m].startY = 0;
  482.                     gAmc[m].finalX = -pixelsToTranslate;
  483.                     gAmc[m].finalY = -pixelsToTranslate;
  484.                     animationPump(m++);
  485.                     bStarted = true;
  486.                 }
  487.                 if ("FlyInFromBottomLeft" == animationType)
  488.                 {
  489.                     animationDuration = el.getAttribute("BSSCDuration", false);
  490.                     if (null == animationDuration)
  491.                         animationDuration = 1000; // default to 1s
  492.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  493.                     {
  494.                         if ("left" == el.children[childIndex].style.textAlign)
  495.                             el.children[childIndex].style.textAlign = "right";
  496.                     }
  497.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  498.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  499.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  500.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  501.                     gAmc[m].startX = -pixelsToTranslate;
  502.                     gAmc[m].startY = pixelsToTranslate;
  503.                     gAmc[m].finalX = 0;
  504.                     gAmc[m].finalY = 0;
  505.                     animationPump(m++);
  506.                     bStarted = true;
  507.                 }
  508.                 if ("FlyOutToBottomLeft" == animationType)
  509.                 {
  510.                     animationDuration = el.getAttribute("BSSCDuration", false);
  511.                     if (null == animationDuration)
  512.                         animationDuration = 1000; // default to 1s
  513.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  514.                     {
  515.                         if ("left" == el.children[childIndex].style.textAlign)
  516.                             el.children[childIndex].style.textAlign = "right";
  517.                     }
  518.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  519.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  520.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  521.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  522.                     gAmc[m].startX = 0;
  523.                     gAmc[m].startY = 0;
  524.                     gAmc[m].finalX = -pixelsToTranslate;
  525.                     gAmc[m].finalY = pixelsToTranslate;
  526.                     animationPump(m++);
  527.                     bStarted = true;
  528.                 }
  529.                 if ("FadeIn" == animationType)
  530.                 {
  531.                     if (gbWindows)
  532.                     {
  533.                         animationDuration = el.getAttribute("BSSCDuration", false);
  534.                         if (null == animationDuration)
  535.                             animationDuration = 1000; // default to 1s
  536.                         finalOpacity = el.getAttribute("BSSCFinalOpacity", false);
  537.                         if (null == finalOpacity)
  538.                             finalOpacity = 100;
  539.                         initialOpacity = el.getAttribute("BSSCInitialOpacity", false);
  540.                         if (null == initialOpacity)
  541.                             initialOpacity = 0;
  542.                         gAmc[m] = new animationContext(el, progressFade, finishFade, animationDuration, 50);
  543.                         el.filters.opacity = initialOpacity;
  544.                         gAmc[m].initialOpacity = initialOpacity;
  545.                         gAmc[m].finalOpacity = finalOpacity;
  546.                         animationPump(m++);
  547.                         bStarted = true;
  548.                     } else {
  549.                         el.style.visibility = "";
  550.                     }
  551.                 }
  552.                 if ("Spiral" == animationType)
  553.                 {
  554.                     animationDuration = el.getAttribute("BSSCDuration", false);
  555.                     if (null == animationDuration)
  556.                         animationDuration = 1000; // default to 1s
  557.  
  558.                     gAmc[m] = new animationContext(el, progressSpiral, finishTranslation, animationDuration, 10);
  559.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  560.                     gAmc[m].el.initTop = document.body.scrollTop+el.offsetTop+document.body.clientHeight;
  561.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  562.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  563.                     gAmc[m].finalX = 0;
  564.                     gAmc[m].finalY = 0;
  565.                     gAmc[m].steps = 0;
  566.                     animationPump(m++);
  567.                     bStarted = true;
  568.                 }
  569.                 if ("ElasticFromRight" == animationType)
  570.                 {
  571.                     animationDuration = el.getAttribute("BSSCDuration", false);
  572.                     if (null == animationDuration)
  573.                         animationDuration = 1000; // default to 1s
  574.                     gAmc[m] = new animationContext(el, progressElasticFromRight, finishTranslation, animationDuration, 10);
  575.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  576.                     gAmc[m].el.initTop = gAmc[m].el.posTop;
  577.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  578.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  579.                     gAmc[m].finalX = 0;
  580.                     gAmc[m].finalY = 0;
  581.                     gAmc[m].steps = 0;
  582.                     animationPump(m++);
  583.                     bStarted = true;
  584.                 }
  585.                 if ("ElasticFromBottom" == animationType)
  586.                 {
  587.                     animationDuration = el.getAttribute("BSSCDuration", false);
  588.                     if (null == animationDuration)
  589.                         animationDuration = 1000; // default to 1s
  590.                     gAmc[m] = new animationContext(el, progressElasticFromBottom, finishTranslation, animationDuration, 10);
  591.                     gAmc[m].el.initLeft = gAmc[m].el.posLeft;
  592.                     gAmc[m].el.initTop = document.body.scrollTop-el.offsetTop-el.offsetHeight;
  593.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  594.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  595.                     gAmc[m].finalX = 0;
  596.                     gAmc[m].finalY = 0;
  597.                     gAmc[m].steps = 0;
  598.                     animationPump(m++);
  599.                     bStarted = true;
  600.                 }
  601.                 if ("ZoomIn" == animationType)
  602.                 {
  603.                     animationDuration = el.getAttribute("BSSCDuration", false);
  604.                     if (null == animationDuration)
  605.                         animationDuration = 1000; // default to 1s
  606.                     gAmc[m] = new animationContext(el, progressZoomIn, finishZoom, animationDuration, 10);
  607.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  608.                     animationPump(m++);
  609.                     bStarted = true;
  610.                 }
  611.                 if ("ZoomOut" == animationType)
  612.                 {
  613.                     animationDuration = el.getAttribute("BSSCDuration", false);
  614.                     if (null == animationDuration)
  615.                         animationDuration = 1000; // default to 1s
  616.                     gAmc[m] = new animationContext(el, progressZoomOut, finishZoom, animationDuration, 10);
  617.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  618.                     animationPump(m++);
  619.                     bStarted = true;
  620.                 }
  621.                 if ("RevealTrans" == animationType)
  622.                 {
  623.                     if (gbWindows) {
  624.                         Duration = el.getAttribute("BSSCDuration", false);
  625.                         if (null == Duration)
  626.                             Duration = 1000; // default to 1s
  627.                         Transition = el.getAttribute("BSSCTransition", false);
  628.                         if (null == Transition)
  629.                             Transition = 0;
  630.                         el.style.filter = "RevealTrans();";
  631.                         el.filters.RevealTrans.Transition = Transition;
  632.                         el.filters.RevealTrans.apply();
  633.                         el.style.visibility = ""; 
  634.                         el.filters.RevealTrans.play(parseInt(Duration)/1000.0);  
  635.                         bStarted = true;
  636.                     } else {
  637.                         el.style.visibility = "";
  638.                     }
  639.                 }
  640.             }
  641.         }
  642.     }
  643.     return bStarted;
  644. }
  645.  
  646. function ApplyTextFormatting(divEl, childEl)
  647. {
  648.     childEl.setAttribute("BSSCOriginalStyle", childEl.style);
  649.  
  650.     // Text Change
  651.     hoverColor = divEl.getAttribute("BSSCHoverColor", false);
  652.     if ("Default" != divEl.getAttribute("BSSCHoverColorName"))
  653.     {
  654.         childEl.setAttribute("BSSCOriginalColor", childEl.style.color);
  655.         childEl.style.color = hoverColor;
  656.     }
  657.     hoverFontName = divEl.getAttribute("BSSCHoverFontName", false);
  658.     if (null != hoverFontName && hoverFontName != "*Default*")
  659.     {
  660.         hoverFontFamily = divEl.getAttribute("BSSCHoverFontFamily", false);
  661.         if (null != hoverFontFamily)
  662.         {
  663.             childEl.setAttribute("BSSCOriginalFontFamily", childEl.style.fontFamily);
  664.             childEl.style.fontFamily = hoverFontFamily;
  665.         }
  666.     }
  667.     hoverFontSize = divEl.getAttribute("BSSCHoverFontSize", false);
  668.     {
  669.         if (null != hoverFontSize && hoverFontSize != "*")
  670.         {
  671.             childEl.setAttribute("BSSCOriginalFontSize", childEl.style.fontSize);
  672.             childEl.style.fontSize = hoverFontSize + "pt";
  673.         }
  674.     }
  675.     hoverFontStyle = divEl.getAttribute("BSSCHoverFontStyle", false);
  676.     if (null != hoverFontStyle && "Regular" != hoverFontStyle)
  677.     {
  678.         if ("Italic" == hoverFontStyle)
  679.         {
  680.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  681.             childEl.style.fontStyle = "italic";
  682.         }
  683.         else if ("Bold" == hoverFontStyle)
  684.         {
  685.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  686.             childEl.style.fontWeight = "bold";
  687.         }
  688.         else if ("Bold Italic" == hoverFontStyle)
  689.         {
  690.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  691.             childEl.style.fontStyle = "italic";
  692.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  693.             childEl.style.fontWeight = "bold";
  694.         }
  695.     }
  696.     hoverUnderline = divEl.getAttribute("BSSCHoverUnderLine", false);
  697.     if (null != hoverUnderline && hoverUnderline == "TRUE")
  698.     {
  699.         childEl.setAttribute("BSSCOriginalTextDecoration", childEl.style.textDecoration);
  700.         childEl.style.textDecoration = "underline";
  701.     }
  702. }
  703.  
  704. function RemoveTextFormatting(el)
  705. {
  706.     originalColor = el.getAttribute("BSSCOriginalColor", false);
  707.     if (null != originalColor)
  708.         el.style.color = originalColor;
  709.     originalFontFamily = el.getAttribute("BSSCOriginalFontFamily", false);
  710.     if (null != originalFontFamily)
  711.         el.style.fontFamily = originalFontFamily;
  712.     originalFontSize = el.getAttribute("BSSCOriginalFontSize", false);
  713.     if (null != originalFontSize)
  714.         el.style.fontSize = originalFontSize;
  715.     originalFontStyle = el.getAttribute("BSSCOriginalFontStyle", false);
  716.     if (null != originalFontStyle)
  717.         el.style.fontStyle = originalFontStyle;
  718.     originalFontWeight = el.getAttribute("BSSCOriginalFontWeight", false);
  719.     if (null != originalFontWeight)
  720.         el.style.fontWeight = originalFontWeight;
  721.     originalTextDecoration = el.getAttribute("BSSCOriginalTextDecoration", false);
  722.     if (null != originalTextDecoration)
  723.         el.style.textDecoration = originalTextDecoration;
  724. }
  725.  
  726. function BSSCOnMouseOver(el)
  727. {
  728.     // Text Formatting
  729.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  730.     if (null != hoverColor)
  731.         for (var index=0; index<el.all.length; index++)
  732.             ApplyTextFormatting(el, el.all[index]);
  733.  
  734.     // Glow
  735.     glowColor = el.getAttribute("BSSCGlowColor", false);
  736.     if (null != glowColor)
  737.     {
  738.         glowStrength = el.getAttribute("BSSCGlowStrength", false);
  739.         if (null == glowStrength)
  740.             glowStrength = "3";
  741.         glowColorName = el.getAttribute("BSSCGlowColorName");
  742.         if ("Default" == glowColorName)
  743.             el.style.filter = "glow(Strength=" + glowStrength + ", enabled=1)";
  744.         else
  745.             el.style.filter = "glow(Color=#" + glowColor + ", Strength=" + glowStrength + ", enabled=1)";
  746.     }
  747. }
  748.  
  749. function BSSCOnMouseOut(el)
  750. {
  751.     // Text Formatting
  752.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  753.     if (null != hoverColor)
  754.         for (var index=0; index<el.all.length; index++)
  755.             RemoveTextFormatting(el.all[index]);
  756.  
  757.     // Glow
  758.     glowColor = el.getAttribute("BSSCGlowColor", false);
  759.     if (null != glowColor)
  760.         el.style.filter="";
  761. }
  762.  
  763. function doStaticEffects()
  764. {
  765.     divElements = document.all.tags("DIV");
  766.     for (var index = 0; index < divElements.length; index++)
  767.     {
  768.         el = divElements[index];
  769.         
  770.         dropShadowColor = el.getAttribute("BSSCDropShadowColor");
  771.         if (null != dropShadowColor)
  772.         {
  773.             dropShadowXOffset = el.getAttribute("BSSCDropShadowXOffset");
  774.             if (null == dropShadowXOffset)
  775.                 dropShadowXOffset = 0;
  776.             dropShadowYOffset = el.getAttribute("BSSCDropShadowYOffset");
  777.             if (null == dropShadowYOffset)
  778.                 dropShadowYOffset = 0;
  779.             dropShadowColorName = el.getAttribute("BSSCDropShadowColorName");
  780.             if ("Default" == dropShadowColorName)
  781.                 el.style.filter = "DropShadow(OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  782.             else
  783.                 el.style.filter = "DropShadow(Color=" + dropShadowColor + ", OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  784.         }
  785.     }
  786. }
  787.  
  788. function drop( targetId )
  789.     target = document.all( targetId );
  790.     if (target.style.display == 'none') {
  791.        target.style.display = "" ;
  792.     } else {
  793.        target.style.display = "none";
  794.     }
  795.     event.cancelBubble = true;
  796. }
  797.  
  798. function checkParent(src,dest)
  799. {
  800.     //Search for a specific parent of the current element.
  801.     while(src !=null)
  802.     {
  803.         if(src.tagName == dest)
  804.         {
  805.             return src;
  806.         }
  807.         src = src.parentElement;
  808.     }
  809.     return null;
  810. }
  811.  
  812. //Generic Display code
  813. function outline2()
  814. {
  815.     //Expand or collapse if a list item is clicked.
  816.     var open = event.srcElement;
  817.  
  818.     //Verify that the tag which was clicked was either the 
  819.     //trigger tag or nested within a trigger tag.
  820.     var el = checkParent(open,"CITE");
  821.     if(null != el)
  822.     {    
  823.         var incr=0;
  824.         var elmPos = 0;
  825.         var parentSpan;
  826.         var fBreak
  827.  
  828.         //Get the position of the element which was clicked
  829.         elemPos = window.event.srcElement.sourceIndex;
  830.  
  831.         //Search for a SPAN tag
  832.         for (parentSpan = window.event.srcElement.parentElement; parentSpan!=null;    parentSpan = parentSpan.parentElement) 
  833.         {
  834.             //test if already at a span tag 
  835.             if (parentSpan.tagName=="SPAN") {
  836.                 incr=1;
  837.                 break;
  838.             }
  839.             
  840.             //Test if the tag clicked was in a body tag or in any of the possible kinds of lists
  841.             //we perform this test because nested lists require special handling
  842.             if (parentSpan.tagName=="BODY" || parentSpan.tagName=="UL" || parentSpan.tagName=="OL") 
  843.             {
  844.                 //Determine where the span to be expanded is.  
  845.                 for (incr=1; (elemPos+incr) < document.all.length; incr++)
  846.                 {    
  847.                     //verify we are at an expandable Div tag
  848.                     if(document.all(elemPos+incr).tagName=="SPAN" && (document.all(elemPos+incr).className=="expanded" || document.all(elemPos+incr).className=="glossexpanded" || document.all(elemPos+incr).className=="glosscollapsed" || document.all(elemPos+incr).className=="collapsed"))
  849.                     {
  850.                         fBreak=1;
  851.                         break;
  852.                     }
  853.                     else if(document.all(elemPos+incr).tagName=="LI")
  854.                     {
  855.                         //If the next tag following the list item (li) is another list item(li) return in order to prevent accidentally opening the next span in the list
  856.                         return;
  857.                     }
  858.                 }
  859.             }
  860.             //determine if we need to break out of the while loop (kind of a kludge since theres no goto in javascript)
  861.             if(fBreak==1)
  862.             {
  863.                 break;
  864.             }
  865.         }
  866.     }
  867.     else
  868.     {
  869.         return;
  870.     }
  871.  
  872.     //Now that we've identified the span, expand or collapse it
  873.     if(document.all(elemPos+incr) == null) {    
  874.         return;
  875.     } else if(document.all(elemPos+incr).className=="collapsed") {
  876.         document.all(elemPos+incr).className="expanded";
  877.     } else if(document.all(elemPos+incr).className=="expanded")  {
  878.         document.all(elemPos+incr).className="collapsed";
  879.     } else if(document.all(elemPos+incr).className=="glosscollapsed") {
  880.         document.all(elemPos+incr).className="glossexpanded";
  881.     } else if(document.all(elemPos+incr).className=="glossexpanded") {
  882.         document.all(elemPos+incr).className="glosscollapsed";
  883.     } else    {
  884.         return;
  885.     }
  886.     event.cancelBubble = true;
  887. }
  888.  
  889.  
  890.